package com.itheima.dao;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args){
     /*   // 1. 使用Scanner录入考试成绩
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入消费金额:");
        int score = sc.nextInt();
        // 2. 判断成绩是否在合法范围内 0~100
        if(score >=0 && score <= 2000){
            if(score >= 1000 && score <= 2000){
                System.out.println("七折");
            }else if(score >= 500 && score <= 1000){
                System.out.println("8折");
            }else if(score >= 0 && score <= 500){
                System.out.println("9.5折");
            }else {
                System.out.println("不享折扣");
            }
        }else{
            System.out.println("非法输入");
        }*/
        while (true) {
            Scanner sc= new Scanner(System.in);
            System.out.println("请输入消费金额");
            int p = sc.nextInt();
            if (p>=0&&p<=2000){
                if (p>=1000&&p<=2000){
                    System.out.println("7折");
                    break;
                }else if (p>=500&&p<=1000){
                    System.out.println("8折");
                    break;
                }else {
                    System.out.println("不打折");
                    break;
                }
            }else {
                System.out.println("您输入非法数据");
            }
        }
    }
}
